<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
    <button id="btn_1">历史列表中URL的数量</button>
	<button id="btn_2">后退按钮</button>
	<button id="btn_3">前进按钮</button>
	<p><a href="19_window对象弹出框.html">01_弹出框</a></p>
	<p><a href="20_window对象窗口.html">02_窗口</a></p>
	<p><a href="21_window对象打印页.html">03_打印当前页面</a></p>
	<p id="text"></p>
 </body>
  <script>
    var $ = function(obj){
	  return document.getElementById(obj);
	}
	window.onload = function(){
	  $("btn_1").onclick = function(){
	     $("text").innerHTML = "历史列表中URL的数量："+history.length;
	  }
	  $("btn_2").onclick = function(){
	     history.back();
	  }
	  $("btn_3").onclick = function(){
	    history.forward();
	  }
	}
  </script>
</html>
